//
//  Common.h
//  CoolTennisBall
//
//  Created by Coollang on 16/7/19.
//  Copyright © 2016年 CoolLang. All rights reserved.
//

#import <UIKit/UIKit.h>


/// 返回当前iPhone OS 运行的版本
extern float OSVersion(void);

/// 返回应用屏幕大小
extern CGRect ApplicationBounds(void);

/// 返回状态栏的高度(横竖屏皆可)
extern CGFloat StatusBarHeight(void);

/// Disk Path
extern NSString *DocumentPath(void);
extern NSString *CachePath(void);
extern NSString *LibraryPath(void);
extern NSString *TempPath(void);

/// 如果obj为空, 则返回 @""
/// 如果不为空，则返回该obj的descrition
extern NSString *MapString(id obj);


//MARK: ----------------- GCD ------------------

extern dispatch_time_t yf_dispatch_time_delay(NSTimeInterval second);

/// 是否主线程
extern BOOL is_main_queue(void);
/// 异步主队列
extern void dispatch_async_main_queue(void (^block)(void));
/// 同步主队列
extern void dispatch_sync_main_queue(void (^block)(void));
/// 异步全局队列
extern void dispatch_async_glogle_queue(void (^block)(void));
/// 同步全局队列
extern void dispatch_sync_glogle_queue(void (^block)(void));
// 同步数据专用队列
//extern void dispatch_async_glogle_queue(void (^block)(void));

@interface Common : NSObject

// inch 转 cm
+ (CGFloat)inchToCm:(CGFloat)inch;
+ (CGFloat)cmToInch:(CGFloat)cm;

// km/h 转mph
+ (CGFloat)kmhToMph:(CGFloat)kmh;
+ (CGFloat)mphToKmh:(CGFloat)mph;

// kg 转 lbs
+ (CGFloat)kgToLbs:(CGFloat)kg;
+ (CGFloat)lbsTokg:(CGFloat)lbs;


@end

